Optimal. Leaf size=147 \[ a^3 A x+\frac {a^3 (28 A+15 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {5 a^3 (4 A+3 C) \tan (c+d x)}{8 d}+\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {(4 A+5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {4140, 4002,
3999, 3852, 8, 3855} \begin {gather*} \frac {5 a^3 (4 A+3 C) \tan (c+d x)}{8 d}+\frac {a^3 (28 A+15 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(4 A+5 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{8 d}+a^3 A x+\frac {C \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{4 a d}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3999
Rule 4002
Rule 4140
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\int (a+a \sec (c+d x))^3 (4 a A+3 a C \sec (c+d x)) \, dx}{4 a}\\ &=\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {\int (a+a \sec (c+d x))^2 \left (12 a^2 A+3 a^2 (4 A+5 C) \sec (c+d x)\right ) \, dx}{12 a}\\ &=\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {(4 A+5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{8 d}+\frac {\int (a+a \sec (c+d x)) \left (24 a^3 A+15 a^3 (4 A+3 C) \sec (c+d x)\right ) \, dx}{24 a}\\ &=a^3 A x+\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {(4 A+5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{8 d}+\frac {1}{8} \left (5 a^3 (4 A+3 C)\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (a^3 (28 A+15 C)\right ) \int \sec (c+d x) \, dx\\ &=a^3 A x+\frac {a^3 (28 A+15 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {(4 A+5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{8 d}-\frac {\left (5 a^3 (4 A+3 C)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{8 d}\\ &=a^3 A x+\frac {a^3 (28 A+15 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {5 a^3 (4 A+3 C) \tan (c+d x)}{8 d}+\frac {C (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {C \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{4 a d}+\frac {(4 A+5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{8 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(363\) vs. \(2(147)=294\).
time = 1.97, size = 363, normalized size = 2.47 \begin {gather*} \frac {a^3 (1+\cos (c+d x))^3 \left (C+A \cos ^2(c+d x)\right ) \sec ^6\left (\frac {1}{2} (c+d x)\right ) \sec ^4(c+d x) \left (-8 (28 A+15 C) \cos ^4(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\sec (c) (24 A d x \cos (c)+16 A d x \cos (c+2 d x)+16 A d x \cos (3 c+2 d x)+4 A d x \cos (3 c+4 d x)+4 A d x \cos (5 c+4 d x)-72 A \sin (c)-72 C \sin (c)+4 A \sin (d x)+23 C \sin (d x)+4 A \sin (2 c+d x)+23 C \sin (2 c+d x)+72 A \sin (c+2 d x)+88 C \sin (c+2 d x)-24 A \sin (3 c+2 d x)-8 C \sin (3 c+2 d x)+4 A \sin (2 c+3 d x)+15 C \sin (2 c+3 d x)+4 A \sin (4 c+3 d x)+15 C \sin (4 c+3 d x)+24 A \sin (3 c+4 d x)+24 C \sin (3 c+4 d x))\right )}{256 d (A+2 C+A \cos (2 (c+d x)))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.69, size = 205, normalized size = 1.39
method | result | size |
derivativedivides | \(\frac {A \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+3 A \,a^{3} \tan \left (d x +c \right )-3 a^{3} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+3 A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,a^{3} \left (d x +c \right )+a^{3} C \tan \left (d x +c \right )}{d}\) | \(205\) |
default | \(\frac {A \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+3 A \,a^{3} \tan \left (d x +c \right )-3 a^{3} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+3 A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,a^{3} \left (d x +c \right )+a^{3} C \tan \left (d x +c \right )}{d}\) | \(205\) |
norman | \(\frac {a^{3} A x +a^{3} A x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-4 a^{3} A x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6 a^{3} A x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-4 a^{3} A x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {7 a^{3} \left (4 A +7 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a^{3} \left (68 A +55 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {a^{3} \left (76 A +73 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {5 \left (4 A +3 C \right ) a^{3} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {a^{3} \left (28 A +15 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a^{3} \left (28 A +15 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(252\) |
risch | \(a^{3} A x -\frac {i a^{3} \left (4 A \,{\mathrm e}^{7 i \left (d x +c \right )}+15 C \,{\mathrm e}^{7 i \left (d x +c \right )}-24 A \,{\mathrm e}^{6 i \left (d x +c \right )}-8 C \,{\mathrm e}^{6 i \left (d x +c \right )}+4 A \,{\mathrm e}^{5 i \left (d x +c \right )}+23 C \,{\mathrm e}^{5 i \left (d x +c \right )}-72 A \,{\mathrm e}^{4 i \left (d x +c \right )}-72 C \,{\mathrm e}^{4 i \left (d x +c \right )}-4 A \,{\mathrm e}^{3 i \left (d x +c \right )}-23 C \,{\mathrm e}^{3 i \left (d x +c \right )}-72 A \,{\mathrm e}^{2 i \left (d x +c \right )}-88 C \,{\mathrm e}^{2 i \left (d x +c \right )}-4 \,{\mathrm e}^{i \left (d x +c \right )} A -15 C \,{\mathrm e}^{i \left (d x +c \right )}-24 A -24 C \right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}-\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{8 d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}+\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{8 d}\) | \(293\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 250, normalized size = 1.70 \begin {gather*} \frac {16 \, {\left (d x + c\right )} A a^{3} + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{3} - C a^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 4 \, A a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 48 \, A a^{3} \tan \left (d x + c\right ) + 16 \, C a^{3} \tan \left (d x + c\right )}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.06, size = 151, normalized size = 1.03 \begin {gather*} \frac {16 \, A a^{3} d x \cos \left (d x + c\right )^{4} + {\left (28 \, A + 15 \, C\right )} a^{3} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (28 \, A + 15 \, C\right )} a^{3} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (24 \, {\left (A + C\right )} a^{3} \cos \left (d x + c\right )^{3} + {\left (4 \, A + 15 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} + 8 \, C a^{3} \cos \left (d x + c\right ) + 2 \, C a^{3}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int A\, dx + \int 3 A \sec {\left (c + d x \right )}\, dx + \int 3 A \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 C \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 C \sec ^{4}{\left (c + d x \right )}\, dx + \int C \sec ^{5}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.50, size = 222, normalized size = 1.51 \begin {gather*} \frac {8 \, {\left (d x + c\right )} A a^{3} + {\left (28 \, A a^{3} + 15 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (28 \, A a^{3} + 15 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (20 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 15 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 68 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 55 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 76 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 73 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 28 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 49 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.65, size = 231, normalized size = 1.57 \begin {gather*} \frac {2\,A\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {7\,A\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {15\,C\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4\,d}+\frac {3\,A\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {3\,C\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {15\,C\,a^3\,\sin \left (c+d\,x\right )}{8\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {C\,a^3\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^3}+\frac {C\,a^3\,\sin \left (c+d\,x\right )}{4\,d\,{\cos \left (c+d\,x\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________